package com.bkq.cb;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class AddScreen extends Activity {
	private Button back, income, spend, lend, borrow;
	private String idUser;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    setContentView(R.layout.add_transaction);
	    back = (Button)findViewById(R.id.backIma_addTransaction);
	    income = (Button)findViewById(R.id.incomeIma_addTransaction);
	    spend = (Button)findViewById(R.id.spendIma_addTransaction);
	    lend = (Button)findViewById(R.id.lendIma_addTransaction);
	    borrow = (Button)findViewById(R.id.borrowIma_addTransaction);
	     
	    Bundle extras = getIntent().getExtras();
			if (extras != null) {
				idUser = extras.getString("idUser").toString();
			}
			
	    back.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
	     
	    income.setOnClickListener(new View.OnClickListener() {
				
				@Override
			public void onClick(View v) {
				Intent i = new Intent(AddScreen.this, IncomeScreen.class);
				Bundle extras = new Bundle();
				extras.putString("idUser", idUser);
				i.putExtras(extras);
				startActivity(i);
			}
		});
	    spend.setOnClickListener(new View.OnClickListener() {
				
				@Override
			public void onClick(View v) {
				Intent i = new Intent(AddScreen.this, SpendScreen.class);
				Bundle extras = new Bundle();
				extras.putString("idUser", idUser);
				i.putExtras(extras);
				startActivity(i);
			}
		});
	    lend.setOnClickListener(new View.OnClickListener() {
				
				@Override
			public void onClick(View v) {
				Intent i = new Intent(AddScreen.this, LendScreen.class);
				Bundle extras = new Bundle();
				extras.putString("idUser", idUser);
				i.putExtras(extras);
				startActivity(i);
			}
		});
	    borrow.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(AddScreen.this,BorrowScreen.class);
				Bundle extras = new Bundle();
				extras.putString("idUser", idUser);
				i.putExtras(extras);
				startActivity(i);
			}
		});
	     }
}
